<%@ page pageEncoding="utf-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title><fmt:message key="flightStateList.title"/></title> 
<script src="<c:url value='/scripts/common.js'/>"></script>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
<link rel="stylesheet" type="text/css" media="all"	href="<c:url value='/styles/layout.css'/>" />
</head>

<body leftmargin="0" topmargin="0">
<html:form action="flightState" >
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td class="home-content-title"><img src="images/home_ico_listTitle.gif" width="22" height="20" align="absmiddle">航班状态管理</td>
  </tr>
  <tr> 
    <td height="25" class="home-table-tool-content02">
     <input type="button" 
                     	class="home-table-inputbox"
        		onclick="location.href='<c:url value="/flightState.html?method=edit"/>'"
        		value="<fmt:message key="button.add"/>"
        		<p:notAllow pid="6541">
        			disabled
        		</p:notAllow>
        		/>
 <input type="button" class="home-table-inputbox"
        		onclick="doDelete('selected_id')"
        		value="<fmt:message key="button.delete"/>"
        		<p:notAllow pid="6543">
        			disabled
        		</p:notAllow>
        		/>	 
    </td>
  </tr>
<tr>
	<td height="30" class="home-search-space">
	名称：&nbsp;<html:text property="name" styleId="name" styleClass="home-table-inputbox" size="12"/>&nbsp;&nbsp;&nbsp;&nbsp;
	代码：&nbsp;<html:text property="code" styleId="code" styleClass="home-table-inputbox" size="12"/>&nbsp;&nbsp;&nbsp;&nbsp;
		 <input name="Submit2" type="button" class="home-inputBtn" value="查询" onClick="javascript:Search();"/>
	    
	</td>
 </tr>

   <tr> 
    <td valign="top"> <table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
        <tr> 
          <td class="home-table-topline"> </td>
        </tr>
        <tr> 
          <td class="home-table-leftline"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-tool-content02"><sasis:page items="${flightStateList}"/></td>
              </tr>
              <tr> 
                <td align="center" valign="top" class="home-edittable-space">	
	<table width="100%" border="0" cellpadding="2" cellspacing="0" class="list_bordercolor">
           <tr> 
                      <td width="6%" class="home-list-title"><div align="center"> 
                          <input type="checkbox" name="checkbox" value="checkbox" onclick="chooseAll(this)"/>
                        </div></td>
                      <td width="30%" class="home-list-title">名称</td>
                      <td width="24%" class="home-list-title">代码</td>
                  	<p:allow pid="6542">
                      <td width="20%" class="home-list-title">更新</td>
					</p:allow>
                      <td width="20%" class="home-list-title">查看</td>
                    </tr>
                    <c:forEach var="results" items="${flightStateList}" varStatus="status">
                    <tr>
                     <tr> 
                       
                      <td class="home-list-content"><div align="center"> 
                         <input type="checkbox" name="selected_id" value="<c:out value='${results.id}'/>" />
                        </div></td>
                     <td class="home-list-content">&nbsp;<c:out value="${results.name}"/></td>
                      <td class="home-list-content">&nbsp;<c:out value="${results.code}"/></td>
	            	<p:allow pid="6542">
                       <td class="home-list-content" width="50">
		    			<img src="./images/edit.gif" width="14" height="14" style="cursor:hand"  alt="<fmt:message key="button.edit"/>" onClick="window.location='./flightState.html?method=edit&id=<c:out value="${results.id}"/>'">&nbsp;
					    </td>
					</p:allow>
		    <td class="home-list-content" width="50">
		    	<img src="./images/view.gif" width="14" height="14" style="cursor:hand"  alt="<fmt:message key="button.view"/>"  onClick="MM_openBrWindow('./flightState.html?method=view&id=<c:out value="${results.id}"/>','','width=500,height=400')">&nbsp;
		    </td>
                    </tr>
		</c:forEach> 
                  </table>
                </td>
              </tr>
            </table></td>
        </tr>
        <tr> 
          <td height="12"> <table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr> 
                <td class="home-table-bottom-left">&nbsp;</td>
                <td class="home-table-bottom-bg">&nbsp;</td>
                <td class="home-table-bottom-right">&nbsp;</td>
              </tr>
            </table></td>
        </tr>
      </table></td>
  </tr>
  <tr> 
    <td height="10">&nbsp;</td>
  </tr>
</table>
</html:form>
</body>
<script>
function Search(){
    //alert("come search");
    //将需要验证的ID传入数组
	var propertyArray = new Array();
	propertyArray.push("name");
	propertyArray.push("code");

	//alert(propertyArray.length)
	//把验证数组传入验证特殊字符函数
	var result=checkSpecialInput(propertyArray);
	//alert("result="+result);
	if(result==true||result==null){
	     //alert(result);
	    flightStateForm.submit();
	     
	}else{
	    alert(result);
	}
}
//written by kellen 07-04-19
function doDelete(chkName){  
		var selected = new Array(); 
		var val = "";	  
		   for (var i=0;i < document.forms[0].elements.length; i++){
				var e = document.forms[0].elements[i];  
				if (e.name==chkName){
					var chk = document.forms[0].elements[i];
					if(chk.checked){
						var bb = e.value; 
					    	selected.push(bb);
					    	break;
					} 
				}	 
			}	 
 		if(0!=selected.length){
 			if(confirm("<fmt:message key="common.confirm.message"/>")){  
				document.forms[0].method="post";
				document.forms[0].action="./flightState.html?method=delete";
				document.forms[0].submit();
			}else return;	  			
		}else{
			alert("<fmt:message key="common.delete.message"/>");
		}	 
	}
</script>
</html> 